import React from 'react';
import { Router, Route, Switch, Redirect } from 'dva/router';
import Products from './routes/Products/Products';
import App from './routes/App';
import Film from './routes/Film';
import Game from './routes/Game';

function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
        <Route path="/" render={() =>
            <App>
              <Switch>
                <Route path="/film" component={Film}/>
                <Route path="/game" component={Game}/>
                <Route path="/products" component={Products}/>

                <Redirect from='/' to='/film' />
              </Switch>
            </App>
          }
        />
      </Switch>
    </Router>
  );
}

export default RouterConfig;
